package com.leyou.common.enums;

import org.springframework.http.HttpStatus;

/**
 * 统一定义异常信息
 */
public enum  ExceptionEnums {

    PRICE_CANNOT_BE_NULL(400,"价格不能为空"),
    CATEGORY_NOT_FOND(404,"商品分类没查到"),
    BRAND_NOT_FOUND(404,"没有查询到品牌"),
    BRAND_SAVE_ERROR(500,"新增品牌失败"),
     GROUP_SAVE_ERROR(500,"新增规格组失败"),
    UPLOAD_FILE_ERROR(500,"文件上传失败"),
    INVALID_FILE_TYPE(400,"无效文件类型"),
    SPEC_GROUP_NOT_FOND(404,"商品规格组没查到"),
    GROUP_UPDATE_ERROR(500,"更新失败"),
    DELETE_GROUP_ERROR(500,"删除规格组失败"),
    GOODS_NOT_FOND(404,"商品不存在"),
    Good_SAVE_ERROR(500,"新增商品失败"),
    GOODS_DETAIL_NOT_FOND(404,"商品详情不存在"),
    GOODS_SKU_NOT_FOND(404,"商品Sku不存在"),
    GOODS_STOCK_NOT_FOND(404,"商品库存不存在"),
    GOODS_UPDATE_ERROR(500,"更新商品失败"),
    INVALID_USER_DATA_TYPE(400,"无效的数据类型"),
    CODE_ERROR(400,"验证码错误"),
    USER_NOT_EXIT(400,"用户名或者密码错误"),
    LOGIN_ERROR(500,"登陆失败"),;

    private int code;
    private String msg;

     ExceptionEnums() {
    }

    ExceptionEnums(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
